#region Using Statements
using System;
using System.Collections.Generic;
using Graphics;
using RayGraphics;
using System.Drawing;
using System.Windows.Forms;
#endregion

namespace NI
{
    
    public class NIController
    {

        public delegate void RayTraceEventHandler();
        public event RayTraceEventHandler raytraceEnvent;

        public void RaiseRaytrace()
        {
            if (raytraceEnvent != null)
            {
                raytraceEnvent();
            }
        }


        //SceneController scene;
        RayGraphics.SceneController scene;

        public NIController()
        {
            scene = new RayGraphics.SceneController(256, true, true);
        }

        public void SetFilm(Film film)
        {
            scene.SetFilm(film);
        }

        public void SetCamera(Camera camera)
        {
            scene.SetCamera(camera);
        }

        public void SetLight(Light light)
        {
            this.scene.SetLight(light);
            
        }

        public void SetReflection(bool state)
        {
            this.scene.Reflection = state;
        }

        public void SetTransmission(bool state)
        {
            this.scene.Transmission = state;
        }

        //public void SetDimension(int dimension)
        //{
        //    this.scene.SetDimension(dimension);
        //}

        public Bitmap Render()
        {
            this.scene.Render();
            return scene.GetRenderImage();
        }
        public Bitmap Render(ref ProgressBar bar)
        {
            this.scene.Render(ref bar);
            return scene.GetRenderImage();
        }

        public List<Graphics.Object3D> Objects
        {
            get {return this.scene.Objects; }
            set { this.scene.Objects = value; }
        }

        public List<Graphics.Light> Lights
        {
            get { return this.scene.Lights; }
            set { this.scene.Lights = value; }
        }

    }
}


